from langchain_community.embeddings import DashScopeEmbeddings

from com.wp.langchain.exercise.config import API_KEY


class EmbeddingInit:
    def __init__(self, model_name="text-embedding-v2", api_key=API_KEY):
        self.embeddings = DashScopeEmbeddings(
            dashscope_api_key=api_key,
            model=model_name
        )

    def get_embeddings(self):
        return self.embeddings
